package com.itcast.datasource.c3p0;

import com.mchange.v2.c3p0.ComboPooledDataSource;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;

/**
 * c3p0 的演示
 */
public class c3p0Demo {
    public static void main(String[] args) throws Exception {
        // 1.创建数据库连接池对象
        DataSource ds = new ComboPooledDataSource();
        // 2.获取连接对象
        Connection connection = ds.getConnection();
        // 3. 打印
        System.out.println(connection);
    }
}
